package com.enums;

//币种
public enum CurrencyEnum {

	RMB("人民币", "0"), MY("美元", "1"), OY("欧元", "2");

	private String name = "";

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private String value = "";

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	CurrencyEnum(String name, String value) {
		this.name = name;
		this.value = value;
	}

	public static String getValue(String name) {
		CurrencyEnum[] carTypeEnums = values();
		for (CurrencyEnum carTypeEnum : carTypeEnums) {
			if (carTypeEnum.getName().equals(name)) {
				return carTypeEnum.getValue();
			}
		}
		return null;
	}

	public static String getName(String value) {
		CurrencyEnum[] carTypeEnums = values();
		for (CurrencyEnum carTypeEnum : carTypeEnums) {
			if (carTypeEnum.getValue().equals(value)) {
				return carTypeEnum.getName();
			}
		}
		return null;
	}
}
